package cmath.cmath;

import com.server.order.orderImpl;
import com.server.runtime.vehicleImpl;

public class RotationalDirection {
// Bereken de draairichting -1=ccw +1=clock
	
	static double _anglediff;
	static double _nextangle;
	static double rotationalDirection;
	
	public static double Calculate(vehicleImpl _object, orderImpl _order)
	{
		_nextangle = Angle.Calculate(_object, _order);
		_anglediff = Angle.CalculateAngleDiff(_object, _nextangle);

		
		if (_object.getDirection() >= _nextangle)
			rotationalDirection = _anglediff > 180 ? 1 : -1;
		else
			rotationalDirection = _anglediff <= 180 ? 1 : -1;
		
		
		return rotationalDirection;
	}
}
